<?php
/**
 * @author 天涯 <mail@phpha.com>
 * @copyright http://blog.phpha.com
 * @link http://blog.phpha.com/vncms
 * @version 1.0
 */
defined('APP_PATH') or exit('Access Denied');
require 'check.php';
class jianli extends check{
	//简历列表
	public function lis(){
		$page = (int) $this->spArgs('page',1) > 1 ? (int) $this->spArgs('page',1) : 1;
		$this->jianli = spClass('m_jianli')->spPager($page,15)->findAll(null,'id DESC');
		$this->pager = spClass('m_jianli')->spPager()->getPager();
		$this->display('jianli_lis.tpl.php');
	}
	//详细浏览
	public function show(){
		if(!$id = intval($this->spArgs('id')))	$this->error('缺少必要参数！',spUrl('jianli','lis'));
		$this->jianli = spClass('m_jianli')->find(array('id'=>$id));
		$this->display('jianli_show.tpl.php');
	}
	//删除简历
	public function del(){
		if(!$id = intval($this->spArgs('id')))	$this->error('缺少必要参数！',spUrl('jianli','lis'));
		if(false != spClass('m_jianli')->delete(array('id'=>$id))){
			$this->success('删除简历成功！',spUrl('jianli','lis'));
		}else{
			$this->error('删除简历失败！',spUrl('jianli','lis'));
		}
	}
}
